﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Frame.master" AutoEventWireup="true"  CodeFile="customer.aspx.cs" Inherits="customer" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleHolder" Runat="Server">
    Danh sách khách hàng
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentHolder" Runat="Server">
    <script type="text/javascript">
        $(document).ready(function () {
            $("#tableOne").tablesorter({ debug: false, sortList: [[0, 0]], widgets: ['zebra'] })
       // .tablesorterPager({ container: $("#pagerOne"), positionFixed: false })
        
     });       
</script>

<div align="center"><asp:Label ID="lblMsg" runat="server" ForeColor="#FF3300" Visible="false"></asp:Label></div>
   
    <table id="addBar" width="930" border="0" align="center" cellpadding="0" cellspacing="0" class="margin_l30">
        <tr>
            <td align="left" valign="bottom">
            <table cellpadding="0" cellspacing="0" width="930" align="left" class="margin_l10 margin_b5">
                <tr>
                    <td>
                    <table cellpadding="2" cellspacing="0" id="tblSearch" runat="server">
                    <tr>
                        <td align="left">Mã khách hàng</td>
                        <td align="left"> Tên khách hàng</td>
                        <td align="left"> Biển số</td>
                        <td align="left"> </td>
                    </tr>
                     <tr>
                        <td align="left"><asp:TextBox ID="txtCode" runat="server" Width="100px" TabIndex="1" MaxLength="10" /></td>
                        <td align="left"><asp:TextBox ID="txtName" runat="server" Width="150px"  
                                TabIndex="2"  MaxLength="100" /></td>
                        <td align="left"><asp:TextBox ID="txtPlat" runat="server" Width="100px"  TabIndex="3" MaxLength="20"/></td>
                        <td align="left"><asp:ImageButton ID="btnSearch" runat="server" 
                                ImageUrl="~/images/view.gif" ToolTip="Tìm kiếm" onclick="btnSearch_Click" /></td>

                    </tr>
                </table>
                    </td>
                    <td align="right"  valign="bottom">
                    <span class="add3"><asp:HyperLink ID="hplAdd" runat="server" NavigateUrl="~/CustomerAction.aspx" Text="Thêm khách hàng"/></span>
                    </td>
                </tr>
            </table>
                
            </td>
        </tr>
    </table>
    
     <asp:Repeater ID="rptCustomer" runat="server"
        onitemcommand="rptCustomer_ItemCommand" 
        onitemdatabound="rptCustomer_ItemDataBound">
        <HeaderTemplate>
            <table id="tableOne" class="yui margin_l30" width="930" border="0" align="center" cellpadding="3" cellspacing="1" >
                <thead>
                    <tr>
                        <th class="tableheader" align="center" width="30">STT</th>
                        <th class="tableheader" align="center"  width="70">Mã KH</th>
                        <th class="tableheader"  align="left">Tên khách hàng</th>
                        <th class="tableheader"  align="left"  width="160">Địa chỉ</th>
                        <th class="tableheader"  align="center"  width="70">Điện thoại</th>
                        <th class="tableheader"  align="center"  width="90">Biển số</th>
                        <th colspan="2" class="tableheader"  align="center">Khách hàng</th>
                        <th colspan="4" class="tableheader" align="center">Vé tháng</th>
                    </tr>
                </thead>
                <tbody>
        </HeaderTemplate>
        <ItemTemplate>
            <tr>
                <td align="center"><%# Container.ItemIndex + 1 %></td>
                <td align="left"><%#Eval("CustomerCode")%></td>
                <td align="left"><%#Eval("CustomerName")%></td>
                <td  align="left"><%#Eval("Address")%></td>
                <td  align="left"><%#Eval("Phone")%></td>
                <td align="left"><%#Eval("MonthCard.PlateNumber")%></td>
                <td align="center" width="30">
                <asp:ImageButton ID="btnDeleteCustomer" OnClientClick="return confirm('Bạn chắc chắn muốn xóa?')" ImageUrl="~/images/delete.gif" ToolTip="Xóa khách hàng" runat="server" CommandName="DeleteCustomer" CommandArgument='<%#Eval("CustomerID")%>'/> 
                </td>
                <td align="center" width="30">
                <asp:ImageButton ID="btnEditCustomer"  runat="server" ImageUrl="~/images/edit.png" ToolTip="Chỉnh sửa khách hàng" Width="14" Height="13" CommandName="EditCustomer" CommandArgument='<%#Eval("CustomerID")%>'/>
                </td>
                <td align="center" width="30">
                <asp:ImageButton ID="btnSellTicket" ImageUrl="~/images/sellIcon.png" ToolTip="Bán vé" runat="server" CommandName="sell" CommandArgument='<%#Eval("CustomerID")%>'/>
                </td>
                <td align="center" width="30">
                <asp:ImageButton ID="btnDeleteTicket" OnClientClick="return confirm('Bạn chắc chắn muốn xóa?')" ImageUrl="~/images/delete.gif" ToolTip="Xóa vé" runat="server" CommandName="DeleteTicket" CommandArgument='<%#Eval("MonthCard.ID")%>'/>
                 </td>
                <td align="center" width="30">
                <asp:ImageButton ID="btnEditTicket"  runat="server" ImageUrl="~/images/edit.png" ToolTip="Chỉnh sửa vé" Width="14" Height="13" CommandName="EditTicket" CommandArgument='<%#Eval("MonthCard.ID")%>'/>
                </td>
                <td align="center" width="30"> 
                <asp:ImageButton ID="btnExtend" ImageUrl="~/images/extendIcons.png" runat="server" CommandName="extend" ToolTip="Gia hạn"  CommandArgument='<%#Eval("MonthCard.ID")%>'/>
                </td>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
        </tbody>
	   
        </table>
        </FooterTemplate>
    </asp:Repeater>
    <table  class="margin_l30" cellpadding="3" cellspacing="0" width="930" border="0">
	        <tr>
                <td  class="tableFooter" valign="middle" align="right">
                    <asp:ImageButton ID="btnFirst" runat="server" ImageUrl="~/images/first.png" 
                        ToolTip="Trang đầu" onclick="btnFirst_Click" /></td>
                <td  class="tableFooter" valign="middle" width="10" align="center">
                    <asp:ImageButton ID="btnPrev" runat="server" ImageUrl="~/images/prev.png" 
                        ToolTip="Trang trước" onclick="btnPrev_Click" /></td>
                <td  class="tableFooter"  valign="middle"  align="center" width="30"><asp:Literal ID="ltrPage" runat="server"  Text="0/0"/></td>
	            <td  class="tableFooter" valign="middle"  align="center" width="10">
                    <asp:ImageButton ID="btnNext" runat="server" ImageUrl="~/images/next.png" 
                        ToolTip="Trang sau" onclick="btnNext_Click" />
		          
		        </td>
                <td  class="tableFooter" valign="middle"  align="left">
                    <asp:ImageButton ID="btnLast" runat="server" ImageUrl="~/images/last.png" 
                        ToolTip="Trang cuối" onclick="btnLast_Click" /></td>
	        </tr>
	    
    </table>
<div align="center"><asp:Label ID="lblInform" runat="server"></asp:Label></div>
</asp:Content>

